import request from '@/utils/request'
import { LoginFormData, LoginResponseData, UserResponseData } from './type'

enum API {
  LOGIN_URL = '/login',

  USERINFO_URL = '/user/info',

  LOGOUT_URL = '/admin/acl/index/logout',
}

export const reqLogin = (data: LoginFormData) => {
  return request.post<any, LoginResponseData>(API.LOGIN_URL, data)
}

export const reqUserInfo = () => {
  return request.get<any, UserResponseData>(API.USERINFO_URL)
}
